#ifndef PAGEENERGY_H
#define PAGEENERGY_H

#include <QWidget>
#include <QKeyEvent>
#include <QEvent>
#include <QLineEdit>
#include <QLabel>
#include <QTimer>
#include "global_def.h"
#include "slimnumkeyboard.h"

namespace Ui {
class PageEnergy;
}

class PageEnergy : public QWidget
{
    Q_OBJECT

public:
    explicit PageEnergy(QWidget *parent = nullptr);
    ~PageEnergy();
    enum
    {
        EGY_PRO,
        EGY_DIS,
        EGY_REG,
        EGY_HVAC
    };
    enum
    {
        DAY,
        MON,
        TOTAL
    };
    //删除偏移量判断类型
    void setSysEnergy(int sys,uint egy);
    void setTotalEnergyConsume(uint egy);
    uint getProEgyMonInput();
    uint getProEgyTotalInput();
    uint getAuxEgyMonInput();
    uint getAuxEgyTotalInput();
    uint getRegEgyMonInput();
    uint getRegEgyTotalInput();
    void setPageActive(bool xActive);
protected:
     bool eventFilter(QObject *obj, QEvent *event);
signals:
    void returnToMaintMenu();
    void egySetValid(bool xValid);
private slots:
    void input_slot(int);
    void backspace_slot();
    void cancel_slot();
    void on_Btn_Return_clicked();
    void on_Btn_EnergySet_clicked();

private:
    Ui::PageEnergy *ui;
    SlimNumKeyBoard *m_pKeyBoard;
    QList<QLineEdit*> inputlist;
    QLineEdit *m_pFocusLinedit;
    QList<QLabel*> m_lEnergyList;
};

#endif // PAGEENERGY_H
